#!/usr/bin/python
# a tool for projects automation

import getopt
import os
import sys
import Utils

__app__ = "wizard"
__version__ = (0,0,1)
__author__ = "Daniel Berns - daniel.w.berns at gmail.com"
__date__ = "20080611"

def start(parameter):  
    if parameter:
        print "start project %s" % parameter
        #mkdir(parameter, templates)
        mkdir(parameter);
        writer = open(''.join([parameter, os.sep, 'execute.py']), 'w')
        writer.write('#!/usr/bin/python\n')
        writer.write('def main():\n')
        writer.write('    pass')
        writer.write('\n\n')
        writer.write('# Start working\n')
        writer.write('if __name__ == "__main__":\n')
        writer.write('   main()\n')
        writer.write('\n\n')
        writer.close()
        writer = open(''.join([parameter, os.sep, 'settings.py']), 'w')
        writer.write('#!/usr/bin/python\n')
        writer.write('execute_settings = {"dir": "."}\n')
        writer.close()

def backup(source, backup, remark):
     utils.execute_backup(source, backup, remark)

def update(parameter):
     pass

def version_author_and_date():
     """Gives version of this app
     """
     print "\n%s version %s by %s (%s)" % (__app__, __version__, __author__, __date__)

